<template>
	<view class="content">
		<view class="detail">
			<block v-if="status == 0">
				<image src="../../static/bind_success.png" mode="aspectFit"></image>
				<view class="desction">
					<view class="title">
						绑定成功
					</view>
					<view class="toast">
						<!-- 您的户号124563478 -->
					</view>
					<view class="btn">
						<button type="primary" @click="submit()">确定</button>
					</view>
				</view>
			</block>
			<block v-else>
				<image src="../../static/bind_fail.png" mode="aspectFit"></image>
				<view class="desction">
					<view class="title">
						绑定失败,请联系管理员
					</view>
					<view class="toast">
						<!-- 请绑定户号 -->
					</view>
					<view class="btn">
						<button type="warn" @click="submit()">确定</button>
					</view>
				</view>
			</block>
		</view>
	</view>
</template>

<script>
	export default {
		data(){
			return {
				status: 0
			}
		},
		onLoad(option) {
			if(option.id){
				uni.setStorageSync('id',option.id);
			}
			this.bind();
		},
		onShow() {
			uni.removeStorageSync('href')
		},
		methods:{
			async bind(){
				let res = await this.api.uniRequ(this.api.public.userBind,{id: uni.getStorageSync('id')});
				if(res.code == 1){
					this.status = 0;
					uni.hideLoading();
					// res
				}else{
					this.status = 1;
				}
			}
		}
	}
</script>

<style lang="scss">
	.content{
		width: 100vw;
		height: 98vh;
		background-color: rgba(0,0,0,0.5);
		padding: 1vh 0;
	}
	.detail{
		width: 75%;
		margin-left: 12.5%;
		height: 704rpx;
		margin-top: 147rpx;
		position: relative;
		z-index: 1;
		image{
			width: 100%;
			height: 100%;
		}
		.desction{
			width: 97%;
			position: absolute;
			bottom: 0;
			left: 0;
			text-align: center;
			.title{
				width: 100%;
				font-size: 36rpx;
				color: #344968;
				font-weight: bold;
			}
			.toast{
				width: 100%;
				color: #808080;
				font-size: 28rpx;
				height: 78rpx;
				line-height: 78rpx;
			}
			.btn{
				width: 100%;
				height: 156rpx;
				button[type="primary"],
				button[type="warn"]{
					width: 80%;
					height: 70rpx;
					line-height: 70rpx;
					margin-top: 43rpx;
					border-radius: 35rpx;
					background-color: #1DD289;
					box-shadow: 0rpx 10rpx 20rpx rgba(30, 211, 139, 0.34);
				}
				button[type="warn"]{
					background-color: #FA6242;
					box-shadow: 0rpx 10rpx 20rpx rgba(250, 98, 66, 0.41);
				}
			}
		}
	}
</style>
